<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Data extends CI_Controller {

    function __construct() {
        parent::__construct();

        /* Standard Libraries of codeigniter are required */
        $this->load->database();
        $this->load->helper('url');
        /* ------------------ */

        $this->load->library('ExCRUD');
    }

    function profil(){
        $crud = new ExCRUD();
        $crud->standartCheck();
        $crud->set_theme('datatables');
        $crud->set_table('static_content');
        $crud->field_type("TITLE","readonly");
        $crud->set_add(false);
        $crud->set_delete(false);
        $crud->order_by('TITLE','asc');
        $output = $crud->render();
        $this->load->view('admin/view_admin',$output);
    }

    function kegiatan(){
        $crud = new ExCRUD();
        $crud->standartCheck();
        $crud->set_theme('datatables');
        $crud->set_table('kegiatan');
        $crud->order_by('DATE_CREATED','desc');
        $output = $crud->render();
        $this->load->view('admin/view_admin',$output);
    }


    function tokoh(){
        $crud = new ExCRUD();
        $crud->standartCheck();
        $crud->set_theme('datatables');
        $crud->set_table('tokoh');
        $crud->order_by('FULL_NAME','asc');
        $output = $crud->render();
        $this->load->view('admin/view_admin',$output);
    }

    function alamat(){
        $crud = new ExCRUD();
        $crud->standartCheck();
        $crud->set_theme('datatables');
        $crud->set_table('alamat');
        $crud->order_by('NO_URUT','asc');
        $output = $crud->render();
        $this->load->view('admin/view_admin',$output);
    }

    function guest_book(){
        $crud = new ExCRUD();
        $crud->standartCheck();
        $crud->set_theme('datatables');
        $crud->set_table('guest_book');
        $crud->order_by('TANGGAL_POSTING','desc');
        $output = $crud->render();
        $this->load->view('admin/view_admin',$output);
    }

    function alternatif_link(){
        $crud = new ExCRUD();
        $crud->standartCheck();
        $crud->set_theme('datatables');
        $crud->set_table('alternatif_link');
        $crud->order_by('NO_URUT','asc');
        $output = $crud->render();
        $this->load->view('admin/view_admin',$output);
    }

    function lowongan(){
        $crud = new ExCRUD();
        $crud->standartCheck();
        $crud->set_theme('datatables');
        $crud->set_table('lowongan');
        $output = $crud->render();
        $this->load->view('admin/view_admin',$output);
    }

    function user(){
        $crud = new ExCRUD();
        $crud->standartCheck();
        $crud->set_theme('datatables');
        $crud->set_table('user');
        $crud->set_relation('ADMIN_SEKOLAH', 'm_database_sekolah', 'NAMA_SEKOLAH');
        $output = $crud->render();
        $this->load->view('admin/view_admin',$output);
    }
}



/* End of file main.php */
/* Location: ./application/controllers/main.php */